package ControlLayer;
import java.util.ArrayList;
import ModelLayer.DVD;
import ModelLayer.Copy;
import ModelLayer.DVDContainer;
//model layer package has to be imported
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 * (FEN): 2006.03.21: Some changes to the architecture in order to assure layering
 *                    and loose coupling
 */
public class DVDCtr
{
    //declare instance variables to reference containers
    private DVDContainer dvdContainer;
       
    public DVDCtr()
    {
        dvdContainer = DVDContainer.getInstance();  
    }
    
    public void addDVD(String title, long id, String artist, String publicationDate )
    {   
         dvdContainer.addDVD(title, id, artist, publicationDate);
    }

    public DVD getDVD(String search)
    {         
        return dvdContainer.getDVD(search);
    }
    
    public void updateDVD(String search, String title, long id, String artist, String publicationDate)
    {
        dvdContainer.updateDVD(search, title, id, artist, publicationDate);
    }
    
    public void deleteDVD(String title)
    {
        dvdContainer.deleteDVD(title);
    }
        
    public void createCopy(String title, String serialNumber, String purchaseDate, String purchasePrice)
    {   
        dvdContainer.addCopy(title, serialNumber, purchaseDate, purchasePrice);
    }
    
    public Copy findCopy(String title)
    {
        return dvdContainer.findCopy(title);
    }
    
    public void deleteCopy(String title, String serialNumber)
    {
        dvdContainer.deleteCopy(title, serialNumber);
    }
    
    public ArrayList listAllDVDs()
    {
        return dvdContainer.listAllDVDs();
    }
    
}
